<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:o="http://openfaces.org/">

	<h:panelGroup id="#{spatialAnalysisHelper.spatialAnalysisPanelName}">
		<rich:panel>
			<ui:include src="/viewer/includes/spatialAnalysisContentIncl.xhtml" />
		</rich:panel>
		<br />
		
		<ui:remove>
		
		<!-- TODO: ver que se hara con esto depues.... -->
		
		<div align="center">
			<o:commandButton type="button"
				rendered="#{render == null}"
				value="#{messages['button.ok']}"
				onclick="#{rich:component('spatialAnalysisPanel')}.hide();">
			</o:commandButton>
			
			<h:panelGroup>
				<h:form rendered="#{render != null}">
					<table style="width:30%">
						<tr>
							<td width="50%" align="center">
								<a4j:commandButton
									value="#{messages['button.ok']}"
									reRender="#{render != null ? render : ''}"
									oncomplete="#{rich:component('spatialAnalysisPanel')}.hide();">
									<f:setPropertyActionListener target="#{spatialAnalysisHelper.spatialZone}" value="#{buildingPermitHelper.permit.spatialZone}" />
									<f:setPropertyActionListener target="#{spatialAnalysisHelper.ruleGroup}" value="#{buildingPermitHelper.ruleGroup}" />
									<f:setPropertyActionListener target="#{spatialAnalysisHelper.distance}" value="#{null}" />
								</a4j:commandButton>
							</td>
							<td align="center">
								<o:commandButton type="button"
									value="#{messages['button.close']}"
									onclick="#{rich:component('spatialAnalysisPanel')}.hide();">
								</o:commandButton>
							</td>
						</tr>
					</table>
				</h:form>
			</h:panelGroup>
		</div>
		</ui:remove>
	</h:panelGroup>

</ui:composition>
